#include <iostream>
#include "BigN.h"

BigN::BigN(string s) {
	if(!n.empty())
		n.clear();
	for(int i=0;i<s.size();i++)
		n.push_back(s[i]-48);
}

BigN::BigN(unsigned long long m) {
	if(!n.empty())
		n.clear();
	if(m == 0)
		n.push_back(0);
	else
		for(;m>0;m/=10)
			n.push_back(m%10);
}

unsigned long long BigN::toInt() {

}

unsigned long long BigN::size() {
	return n.size();
}

char& BigN::operator [](const unsigned long long& i) {
	return n[i];
}

bool BigN::operator==(const BigN& bign) {
	if(n.size()!=bign.size())
		return false;
	for(int i=0;i<n.size();i++)
		if(n[i]!=bign[i])
			return false;
	return true;
}


bool BigN::operator!=(const BigN& bign) {
	return !(*this==bign);
}

bool BigN::operator<(const BigN& bign) {
	if(n.size()<bign.size())
		return true;
	for(int i=n.size()-1;i>=0;i--)
		if(n[i]<bign[i])
			return true;
	return false;
}

bool BigN::operator>(const BigN& bign) {
	if(n.size()<bign.size())
		return false;
	for(int i=n.size()-1;i>=0;i--)
		if(n[i]>bign[i])
			return true;
	return false;
}

bool BigN::operator<=(const BigN& bign) {
	return !(*this>bign);
}

bool BigN::operator>=(const BigN& bign) {
	return !(*this<bign);
}

ostream& BigN::operator<<(ostream& os) {
	for(int i=n.size()-1;i>=0;i++)
		os<<n[i];
	return os;
}

BigN BigN::operator+(const BigN& bign) {

}

int main() {
	BigN n("50");
	//cout<<n<<endl;
}
